def solution(array):
    # Edit your code here
    freq = {}
    for num in list(set(array)):
        freq[num] = array.count(num)
        if freq[num] > len(array) /2:
            return num
    return 0


if __name__ == "__main__":
    # Add your test cases here

    print(solution([1, 3, 8, 2, 3, 1, 3, 3, 3]) == 3)